import java.awt.image.BufferedImage;
import java.io.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.*;
import java.net.*;
import java.sql.*;

import javax.imageio.ImageIO;

import static java.lang.System.out;
public class PicClientHandler extends Thread {
		ServerSocket myServer;

	 public PicClientHandler(ServerSocket  myServer) {
		System.out.println("PicClientHandler Started");
		this.myServer = myServer;
		start();
	 }
	 public void run(){
		 while(true) {
			 Socket newClient;
			 try{
			  if(myServer==null) System.out.println("Error");
			  newClient = myServer.accept();
			//  System.err.println("A new client");
			  System.out.println("A new client");
			  PicClientThread myClients = new PicClientThread(newClient);
			 // myClients.sendImage();
		     // String value = myClients.getIp();
		      synchronized(this)
		      {
		    	//  clientList.put(value, myClients);
		      }
			 }catch( IOException e ){
				 System.err.println(e);
		   }
		}  // end of while
	 }

}
